<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>vue中的列表循环</title>
  <script src="../asset/js/vue.js"></script>
</head>

<body>
  <div id="app">
    <template v-for="(item,index) of list">
      <div :key='item.id'>
        {{item.text}} --- {{index}}
      </div>
      <span>
        {{item.text}}
      </span>
    </template>
  </div>
  <script>
    // push pop shift unshift splice sort reverse 改变数组
    let vm = new Vue({
      el: '#app',
      data: {
        list: [{
            id: '01',
            text: 'hello'
          },
          {
            id: '02',
            text: 'dell'
          },
          {
            id: '03',
            text: 'nice'
          },
          {
            id: '04',
            text: 'to'
          },
          {
            id: '05',
            text: 'meet'
          },
          {
            id: '06',
            text: 'you'
          }
        ]
      }
    })
  </script>
</body>

</html>